package com.javagroup.chessonline.callback;

import com.javagroup.chessonline.client.Client;
import com.javagroup.chessonline.view.LobbyView;
import com.thuan.hibernate.Utils;

public class LobbyBackBtnCallback extends ClientCallback{

	private LobbyView mLobbyView;
	public LobbyBackBtnCallback(Client client, LobbyView lobbyView) {
		super(client);
		
		this.mLobbyView = lobbyView;
	}
	
	@Override
	public void perform() {
		if(Utils.getLeagueId() != -1) { // In Room League view 
			mLobbyView.showLeague();
		} else if(Utils.isLeagueMode()){ // In the League view
			mLobbyView.showRoom();
		}
		else {
			mMainScreen.showHomePageView();
		}
		
	}

}
